package com.donfu.system.service.house.impl;

import java.util.Date;
import java.util.List;

import com.donfu.system.domain.house.HouseSpecValue;
import com.donfu.system.mapper.house.HouseSpecValueMapper;
import com.donfu.system.service.house.IHouseSpecValueService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 商品规格参数可选值Service业务层处理
 * 
 * @author donfu
 * @date 2021-12-06
 */
@Service
public class HouseSpecValueServiceImpl implements IHouseSpecValueService
{
    @Autowired
    private HouseSpecValueMapper houseSpecValueMapper;

    /**
     * 查询商品规格参数可选值
     * 
     * @param id 商品规格参数可选值主键
     * @return 商品规格参数可选值
     */
    @Override
    public HouseSpecValue selectHouseSpecValueById(Long id)
    {
        return houseSpecValueMapper.selectHouseSpecValueById(id);
    }

    /**
     * 查询商品规格参数可选值列表
     * 
     * @param houseSpecValue 商品规格参数可选值
     * @return 商品规格参数可选值
     */
    @Override
    public List<HouseSpecValue> selectHouseSpecValueList(HouseSpecValue houseSpecValue)
    {
        return houseSpecValueMapper.selectHouseSpecValueList(houseSpecValue);
    }

    /**
     * 新增商品规格参数可选值
     * 
     * @param houseSpecValue 商品规格参数可选值
     * @return 结果
     */
    @Override
    public int insertHouseSpecValue(HouseSpecValue houseSpecValue)
    {
        houseSpecValue.setCreateDate(new Date());
        return houseSpecValueMapper.insertHouseSpecValue(houseSpecValue);
    }

    /**
     * 修改商品规格参数可选值
     * 
     * @param houseSpecValue 商品规格参数可选值
     * @return 结果
     */
    @Override
    public int updateHouseSpecValue(HouseSpecValue houseSpecValue)
    {
        houseSpecValue.setUpdateDate(new Date());
        return houseSpecValueMapper.updateHouseSpecValue(houseSpecValue);
    }

    /**
     * 批量删除商品规格参数可选值
     * 
     * @param ids 需要删除的商品规格参数可选值主键
     * @return 结果
     */
    @Override
    public int deleteHouseSpecValueByIds(Long[] ids)
    {
        return houseSpecValueMapper.deleteHouseSpecValueByIds(ids);
    }

    /**
     * 删除商品规格参数可选值信息
     * 
     * @param id 商品规格参数可选值主键
     * @return 结果
     */
    @Override
    public int deleteHouseSpecValueById(Long id)
    {
        return houseSpecValueMapper.deleteHouseSpecValueById(id);
    }
}
